<?php

	error_reporting(E_ALL^E_NOTICE);
	
	$dir = opendir(".");
	$extention = '';
	
	while($entryName = readdir($dir)) {
		if($entryName{0}=='.') continue;
		$extention = strtolower(end(explode('.',$entryName)));
		if($extention == 'php') continue;
		$dirArray[] = $entryName;
	}
	
	closedir($dir);

	$indexCount = count($dirArray);
	
	sort($dirArray);

?>
<!doctype html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Fast Downloads Viewer</title>
	<style type="text/css">
		body {font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight: 300;}
		#file-manager{background-color:#EEE;border:1px solid #DDD;width:400px;margin:50px auto;padding:10px}
		ul.manager li{background:#F5F5F5;border:1px solid #DDD;border-top-color:#FFF;list-style:none;position:relative}
		ul.manager li a{display:block;padding:8px}
		ul.manager li a:hover .download-label{display:block}
		span.download-label{background-color:#64B126;border:1px solid #4E9416;color:#FFF;display:none;font-size:10px;position:absolute;right:8px;text-decoration:none;text-shadow:0 0 1px #315D0D;top:6px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:2px 4px}
		span.download-count{color:#999;font-size:10px;position:absolute;text-decoration:none;padding:3px 5px}
		a:hover {text-decoration: none; color: #ff9900;}
		a {text-decoration: none}
	</style>
</head>
<body>
<div id="file-manager">
	<?php print ("<b>$indexCount</b> files<br />\n"); ?>
	<ul class="manager">

		<?php
			for($index=0; $index < $indexCount; $index++) {
				if (substr("$dirArray[$index]", 0, 1) != "."){
					print("<a href=\"$dirArray[$index]\">$dirArray[$index]</a><br />");
				}
			}
		?>
	</ul>

</div>
</body>
</html>